﻿
function GetVistor() {
    var pData = {};
    //var pData = $.string.Format("CustomerName={0}&Phone={1}&Address={2}&Email={3}", $("#txtName").val(), $("#txtPhone").val(), $("#txtAddress").val(), $("#txtEmail").val()) + "}";
    // var pData = { CustomerName=$("#txtName").val(), Phone: $("#txtPhone").val(), Address: $("#txtAddress").val(), Email: $("#txtEmail").val() };

    $.ajax({
        url: '../Home/Service/VisitorService.asmx/GetVistor',
        type: 'POST',
        data: pData,
        cache: false,
        // contentType: "application/json; charset=utf-8",
        // dataType: "json",
        success: function (data, textStatus, jqXHR) {
            data = $(data).find("string").text();
            var mas = eval("(" + data + ")");
            $("#txtOnlineNum").html(mas.Online);
            $("#txtTodayNum").html(mas.Today);
            $("#txtWeekNum").html(mas.Week);
            $("#txtTotalNum").html(mas.Total);
            //overlay.Hide();
        },
        beforeSend: function (jqXHR, settings) {
            //
            // overlay.Show();


        },
        error: function (jqXHR, textStatus, errorThrown) {
            //overlay.Hide();
        },
        complete: function (XMLHttpRequest, textStatus) {
            //overlay.Hide();
        }
    });
}

$(function () {
    GetVistor();
});